{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "8bf81729-be05-43e3-80d6-6f7936038d72",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.datasets import load_iris\n",
    "from sklearn.model_selection import train_test_split\n",
    "x,y=load_iris().data[:,2:4],load_iris().target\n",
    "x_train,x_test,y_train,y_test=train_test_split(x,y,random_state=1,test_size=50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "568a4bf7-5c6d-4491-a6ce-e18c48115df2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "模型预测准确率： 0.98\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn.metrics import accuracy_score\n",
    "model=LogisticRegression()\n",
    "model.fit(x_train,y_train)\n",
    "ac=accuracy_score(y_test,model.predict(x_test))\n",
    "print('模型预测准确率：',ac)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "89af51b1-69db-42f8-8768-31e1ae209cc9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiUAAAGyCAYAAAA75rSNAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAOZVJREFUeJzt3Xl4VPWhxvF3ICRIyMKioBAWBStLUcFYpFdBRbDKVkRvkFqF20eWlgIWewkFqr1W9D4RUXsr4oZQXHDlFi4CSqCigIZNaALIElkqNmDIJBKynvtHmoEhmWHO5MycMzPfz/PMQ8/MOXN+J/g0L78583tdhmEYAgAAsFkjuwcAAAAgEUoAAIBDEEoAAIAjEEoAAIAjEEoAAIAjEEoAAIAjEEoAAIAjEEoAAIAjEEoAAIAjBBVKTp48qc8++0wnTpywejwAACBGmQ4lb775prp06aJf/vKX6tChg958880LHrN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vEhBKACAKmG0brn1Nqv95M43DkTTDEEljjUWEEgARg9mS+gXa22KlSOzEiaSxxipudAWACGdHH0skduJE0lhjFaEEAAA4AqEEQERh3RIgehFKAEQcggkQnQglAADAEQglACISsyVA9CGUAIhYBBMguhBKACDC2dHHEomdOJE01lhF9w0QBLpvnIUF1VjRNVCRNNZIR/cNgJjESq++f5F26uT7GF+v+TvGzLmdKJLGGov4+AYAADgCMyUAooITZkvs/AglVln5cQwf7djPVChZvny5pk2bpsOHD6tPnz5atGiRunXr5veYDRs2aMKECSooKNDMmTP10EMPNWjAAOBEdpbixSorC/Yo63OGgD++OXDggMaOHasnnnhCx44dU8eOHfWLX/zC7zEFBQUaNmyYRo8erU2bNmnp0qXKzs5u8KABoD52fkXYzlK8WGVlwR5lfc4QcCjJy8vT448/rnvuuUdt2rTRxIkTlZOT4/eYpUuX6tJLL9Xs2bPVtWtXzZkzRy+//HKDBw0AvrB2CRC5Av74ZsiQIV7be/fuVZcuXfwes3PnTt1yyy1yuVySpOuvv16ZmZl+jykrK1NZWZln2+12BzpEAAAQwYL69k15ebmysrI0adIkv/u53W517tzZs52cnKxjx475PWbu3LlKSUnxPNLS0oIZIoAYxmwJEJmCCiWzZs1S8+bN9eCDD/rdLy4uTgkJCZ7tpk2b6vTp036PyczMVFFRkedx5MiRYIYIIMYRTIDIY/orwWvXrtWCBQu0efNmNWnSxO++LVu2VEFBgWe7uLhY8fHxfo9JSEjwCjIAACA2mJopOXjwoMaMGaPnn39e3bt3v+D+6enp2rx5s2d7x44dateunflRAkAQmC0BIkvAoaS0tFRDhgzRiBEjNHz4cJWUlKikpESGYcjtdquioqLOMcOGDdPGjRuVnZ2tyspKZWVlafDgwZZeAAD4E65gYmcpXqyysmCPsj5nCPjjm9WrVysvL095eXl68cUXPc8fOnRIAwYM0Pz58zVixAivY1q3bq2nnnpKgwcPVkpKihITE/lKMICo1LZtzcJarOgaPv5+5rUC/TlZ+V4IXlhagvfv36+8vDz1798/4KbAWrQEw4loCY48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6hhE2vXr308ccfq0ePHho7dqzdwwmpM2fOaPz48Xr++edjqqBszJgx2rx5s9LT09W5c2f96U9/0po1a+R2u+0eWki99957+v7777Vu3TrNnj1ba9as0alTpzw9arFgwYIFXjPB0Wzz5s3661//qi1btqi4uFijR4/WHXfcISPAdVodG0ri4uLqLE/btGlTnT592qYRIRzWrl2rBQsW6PXXX1eTJk3sHk7YuFwuXXvttVq0aJGWL18e1eH7v/7rv5Senq4777zT7qHYKjU1VdXV1frmm2/sHkpIHT16VD/60Y88jfJxcXHq1auXDh06ZPPIwmP//v3av3+/Bg4caPdQwuKtt95SRkaGrr/+ejVv3lyPPfaYDh48qJ07dwZ0vGNDScuWLVVQUOD1XHFxseLj420aEULt4MGDGjNmjJ5//nl1797d7uGExbp16/Twww97tuPiauqozFR9R5rXX39dy5cv99wA+Prrr2vSpElR/3HdQw89pGXLlnm2v/jiCzVq1EhpaWk2jir00tLSVFpa6vXc119/rY4dO9o0ovBatmyZhgwZEjP/yKqsrNS3337r2S4uLtb333+vqqqqgI43VcgXTunp6XrppZc82/n5+SorK/OkbUSX0tJSDRkyRCNGjNDw4cNVUlIiSUpMTJTL5bJ5dKFz1VVXacSIEeratat+8pOfaNasWRo0aJBSUlLsHlrIfPLJJ6qsrPRsT58+XX379tUDDzxg36DC4JprrtHvfvc7tW3bVpWVlZo8ebIeeOABz31z0erOO+/U5MmTtWDBAg0ZMkTvvfeeduzYodtvv93uoYXFhx9+GPUfyZ7rxz/+scaNG6enn35abdq00UsvvaQ2bdqoV69egb1BiL6q3GAVFRXGxRdfbLz22muGYRjG+PHjjSFDhtg8qvBSDK1T8v777xuS6jxi4fo//PBDo1u3bkZSUpIxatQo45///KfdQwqr+++/P2bWKZkxY4aRmppqpKWlGb/+9a+NkpISu4cUFps2bTL69etnXHTRRUbnzp2N999/3+4hhcXp06eN+Ph4Iy8vz+6hhE11dbXxyCOPGB06dDCaNGliXHvttUZOTk7Axzu6JfiDDz7Qvffeq6SkJFVVVWnDhg3q0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1C+FMCYDVCCQCfqqurVV1draefflojR46UJB0/ftwzc/HRRx/p1ltvVUlJiZ566imNGTNGubm5crvd+vbbb7V27Vq98cYbuuGGGzR9+nRVV1fXe47evXurefPmuvHGGzVr1ix17NhRLpdLJSUluuWWW3THHXfo448/VkZGhiTplVde0Y033uhZdK20tFSHDh1Su3btNG3aNLVu3Vp79+7V3//+d3333XdBLVkPIPy40RWAT2VlZTpz5oxn+8Ybb9TUqVPVuXNnSVKTJk302GOP6fjx4/r000+VnZ2trVu36tFHH1XXrl2VnZ2tdu3aqXnz5rrhhhv06quvet1PsmnTJt14440yDEM//vGP9eqrr+onP/mJJOn222/XPffco2bNmqm6ulqJiYmaP3++pJpv10yZMkXvvPOO5syZo6qqKvXr10+zZs3STTfdpDVr1uj//u//9N///d/Ky8vTxIkT9eyzz4bvBwcgKCyeBsBWq1evVnp6uufGWDPKy8tVUlLi99iKigpVVVWxgBoQAQglAADAEbinBAAAOAKhBAAAOAKhBAAAOAKhBAAAOAKhBAAAOAKhBAAAOAKhBAAAOAKhBAAAOML/A9aFMs97GglIAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from matplotlib.colors import ListedColormap\n",
    "import numpy as np\n",
    "N,M=500,500\n",
    "t1=np.linspace(0,8,N)\n",
    "t2=np.linspace(0,3,M)\n",
    "x1,x2=np.meshgrid(t1,t2)\n",
    "x_new=np.stack((x1.flat,x2.flat),axis=1)\n",
    "y_predict=model.predict(x_new)\n",
    "y_hat=y_predict.reshape(x1.shape)\n",
    "iris_cmap=ListedColormap(['#ACC6C0','#FF8080','#A0A0FF'])\n",
    "plt.pcolormesh(x1,x2,y_hat,cmap=iris_cmap)\n",
    "plt.scatter(x[y==0,0],x[y==0,1],s=30,c='g',marker='^')\n",
    "plt.scatter(x[y==1,0],x[y==1,1],s=30,c='r',marker='o')\n",
    "plt.scatter(x[y==2,0],x[y==2,1],s=30,c='b',marker='s')\n",
    "plt.rcParams['font.sans-serif']='Simhei'\n",
    "plt.xlabel('花瓣长度')\n",
    "plt.xlabel('花瓣宽度')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "89cbda12-0781-4a08-9c4b-c6a90f5486ba",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
